/*********************************************************************\
*
*                  (c) lkc
*                  All Rights Reserved. lkc Confidential
*
\*********************************************************************/
/*********************************************************************\
*   Title                      :
*
*   Module Description         :
*
*   Author                     : lkc
*
*   Created                    : 2018-7-31
*
\*********************************************************************/

#ifndef UDPSOCKQT_H
#define UDPSOCKQT_H

#include <QUdpSocket>
#include "CommBaseQt.h"

class UDPSockQt : public CommBaseQt
{
public:
    UDPSockQt(int port, QObject* parent = nullptr);
    ~UDPSockQt();
    bool Open() override;
    void Close() override;
    int Send(const unsigned char *sendBuf, int dataLen) override;
    QUdpSocket m_socket;
private:
    int Read(unsigned char * readbuf, int dataLen) override;
private:
    QHostAddress m_clientAddress;
    quint16 m_clientPort;
    bool m_clientHasAddr = false;
    int m_portNum;
};



#endif // UDPSOCKQT_H

/********************************************************************\
 *
 * REVISION RECORDS
 *
\*********************************************************************/
/*********************************************************************/
/*
 *
 *
 *
\*********************************************************************/
/*------------------------------The End------------------------------*/
